package book;

public class BookList{
    private Book[] bookLists = new Book[10];//书架的容量，可以放10本书
    private int usedSize;//记录当前书架上有几本书

    public Book[] getBookLists() {
        return bookLists;
    }

    public void setBookLists(Book[] bookLists) {
        this.bookLists = bookLists;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public BookList(){
        bookLists[0] = new Book("三国演义","罗贯中",89,"小说");
        bookLists[1] = new Book("西游记","施耐庵",78,"小说");
        bookLists[2] = new Book("红楼梦","曹雪芹",49,"小说");
        this.usedSize = 3;
    }

    public Book getBook(int pos){
        return bookLists[pos];
    }
    public void setBooks(int pos,Book book){
        bookLists[pos] = book;
    }
}
